package cn.itcast.service.impl;


import cn.itcast.dao.AddressDao;
import cn.itcast.pojo.Address;
import cn.itcast.service.AddressService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {

    @Autowired
    private AddressDao addressDao;
    /**
     * 查询所有分院信息
     * @return
     */
    @Override
    public List<Address> findAll() {

        return addressDao.findAll();
    }

    /**
     * 添加分院信息
     * @param address
     * @return
     */
    @Override
    public Boolean submit(Address address) {
        return addressDao.submit(address);
    }

    /**
     * 删除分院信息
     * @param id
     * @return
     */
    @Override
    public Boolean delete(Integer id) {
        return addressDao.delete(id);
    }

    //修改之前查询
    @Override
    public Address findById(Integer id) {
        return addressDao.findById(id);
    }

    //修改
    @Override
    public boolean addressUpdate(Address address) {
        return addressDao.addressUpdate(address);
    }

    //修改启动按钮
    @Override
    public boolean enableUpdate(String enable ,Integer id) {
        return addressDao.enableUpdate(enable,id);
    }
}
